var wd = $(window).width(); let helpVisible = false; let helpUnslicked = false; let getCaption = () => { $("captionKey").each(function(e) { let attr = GetCaption($(this).data('caption')); $(this).html(attr); }); }; function CheckGame() { return GameName == "GemStones" || GameName == "LuckyDouble" || GameName == "ZodiacScratch" || GameName == "LuckySeven" || GameName == "russinapoker" || GameName == "ThreeCardPoker"; } $(document).ready(function() { getCaption(); HelpDiv(); $('.close-help').click(function() { closeHelp(); }); $(".currency").text(currencyCode); }); function closeHelp() { // gameInfo.helpView = false; $('#help').fadeOut(0); if (!helpUnslicked) { $('.help-slider').slick('unslick'); } helpVisible = false; helpUnslicked = false; window.parent.postMessage({name: "prize-drop-show-icon"}, "*"); } function showHelp() { if(GameVersion) $('#game-version').html(GetCaption('game.version') + ' ' + GameVersion); /* gameInfo.helpView = true;*/ $('#help').fadeIn(200); helpVisible = true; $('.help-slider').slick({ dots: true, infinite: true, speed: 300, touchMove: true, slidesToShow: 1, adaptiveHeight: true }); window.parent.postMessage({name: "prize-drop-hide-icon"}, "*"); wd = $(window).width(); if (wd <= 568) { if (!helpUnslicked && !CheckGame() && GameName !== "FootballX" && GameName !== "HunterX" && GameName !== "MineIsland" && GameName !== "SmashX" && GameName !== "RollX") { helpUnslicked = true; $('.help-slider').slick('unslick'); } } // scroll to top if(GameName === "SmashX"){ $('.slick-arrow, .slick-dots li').on( "click", function() { $('.slick-slide').scrollTop(0) } ); } } $(window).resize(function() { if (helpVisible) { wd = $(window).width(); if (wd <= 568 && !CheckGame() && GameName !== "FootballX" && GameName !== "HunterX" && GameName !== "MineIsland" && GameName !== "SmashX" && GameName !== "RollX") { if (!helpUnslicked) { helpUnslicked = true; $('.help-slider').slick('unslick'); } } else { if (helpUnslicked) { helpUnslicked = false; var slickOpts = { dots: true, infinite: true, speed: 300, touchMove: true, slidesToShow: 1, adaptiveHeight: true }; $('.help-slider').slick(slickOpts); } } } }); $(window).resize(function() { HelpDiv(); }); var help_scale = 1; function HelpDiv() { var width = $(window).width(); var height = $(window).height(); var o_width = 1446; var o_height = 1080; if (bowser.mobile) { o_width = 1280; o_height = 760; if (height > width && !CheckGame()) { $('.help-slider.help-border').css('overflow-y', 'auto'); o_width = 760; o_height = 1280; } else { $('.help-slider.help-border').css('overflow-y', 'unset'); } } var w_scale = 0; var h_scale = 0; w_scale = width / o_width; h_scale = height / o_height; m_scale = Math.min(w_scale, h_scale); help_scale = m_scale; if (help_scale > 1) help_scale = 1; var left = (width - $('.container').width() * help_scale) / 2; var top = (height - $('.container').height() * help_scale) / 2; if (CheckGame() && window.matchMedia("(orientation:portrait)").matches) { left = (width + $('.container').height() * help_scale) / 2; top = (height - $('.container').width() * help_scale) / 2; } if (bowser.mobile) { if (CheckGame() && window.matchMedia("(orientation:portrait)").matches) { $('.container').css({ transform: 'scale(' + help_scale + ',' + help_scale + ') rotate(' + 90 + 'deg)' , margin: 0, left: left, top: top }); } else { $('.container').css({ transform: 'scale(' + help_scale + ',' + help_scale + ')', margin: 0, left: left, top: '0' }); } } else { $('.container').css({ transform: 'scale(' + help_scale + ',' + help_scale + ')', margin: 0, left: left, top: top }); } } // debugger; /*showHelp()*/ // fade: true, // cssEase: 'linear'